<?php

// AdminController class
// handle admin login
class AdminController {

    private static $_Admin_Hash = "sC%#WE6vf5rb^GBUgb7EDYHUNumnbd3456789SRDFVGHNJKOJMUGBXTUNhfsxxwsrfvHNJin";
    
    public static function getAdminUser() {
        return "Admin";
    }   

    public static function getAdminPass() {
        return "123";
    }    
    
    // set vars for admin to log in
    public static function isAdminLogin() {
        if ( isset ($_SESSION["AdminLoggedIn"]) &&  $_SESSION["AdminLoggedIn"] &&
               isset ($_SESSION["AdminHash"]) &&  $_SESSION["AdminHash"] == self::$_Admin_Hash ) {
            return true;
        } 
        else {
            return false;
        }
    }     
    
    // set vars for admin to log in
    public static function executeAdminLogin() {
        $_SESSION["AdminLoggedIn"] = 1;
        $_SESSION["AdminHash"] = self::$_Admin_Hash;
    } 
    
    // set vars for admin to log out
    public static function executeAdminLogout() {
        unset($_SESSION["AdminLoggedIn"]);
        unset($_SESSION["AdminHash"]);
    } 
    
    
}